//分享
function shareTo(id){
	createXMLRequest();  
	var i=document.getElementById('larger'+id);      
	if (i){
		imgurl=document.getElementById('larger'+id).src;
	} else {
		imgurl="";
	}
	img=imgurl.split('-');
	var sharemsg=document.getElementById("sharemsg"+id).value;
	var beforeShare=document.getElementById("c"+id).value;
	var sharemsgeurl="/users/share/?sharemsg="+sharemsg+"&img="+img[0]+"&id="+id+"&before="+beforeShare;
	xmlHttp.open('GET',sharemsgeurl);
	xmlHttp.onreadystatechange=rtn(id);
	xmlHttp.send(); 
}

function rtn(id){
	if(xmlHttp.readyState==4 && xmlHttp.status==200){
		$("#shareThis"+id).modal('hide');
		count=document.getElementById('share'+id);
		count.innerHTML=parseInt(count.innerHTML)+1;
		window.location.reload();
	} else {
		$("#shareThis"+id).modal('hide');
		count=document.getElementById('share'+id);
		count.innerHTML=parseInt(count.innerHTML)+1;
		window.location.href="/users/";
	}
}
